﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace The_LarX
{
    public class Node_DrawString : VisualScript_Node, IVisualScriptNode_Actor
    {
        public Node_DrawString() { Load(); }
        public Node_DrawString(VisualScript script)
            : base(script) { Load();  }

        private void Load()
        {
            descriptionName = "DrawString";
            Text = descriptionName;
            Shadow = 2;
            Position = new Vector2(50);
            FontName = "Kootenay";
            Color = Color.White;
            Scale = Vector2.One;
            this.RepresentationType = typeof(VSRBase);
        }

        public string Text { get; set; }
        public float Shadow { get; set; }
        public Vector2 Position { get; set; }
        public string FontName { get; set; }
        public Color Color { get; set; }
        public float Rotation { get; set; }
        public Vector2 Origin { get; set; }
        public Vector2 Scale { get; set; }
        public float Depth { get; set; }
        public bool UseCamera { get; set; }
        public bool OverrideEngineResize { get; set; }

        public override void Draw()
        {
            if (AllConditionsAllow())
            {
                base.Draw();

                Engine.RenderManager.DrawString(Text, Shadow, 255, Position, FontName, Color,
                    Rotation, Origin, Scale, Depth, null, OverrideEngineResize);
            }
        }
    }
}
